﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Xtensive.Storage;
using Xtensive.Integrity.Aspects.Constraints;

namespace SMS.Core.Model.Data
{
    class Customer : Entity
    {
        [Key, Field]
        public int cust_id { get; private set; }

        [Field]
        public EntitySet<Cust_order> cust_orders { get; set; }  // TODO: icheck balik

        [Field]
        public EntitySet<Cust_contact> cust_contacts { get; set; } // a customer can have many contacts

        [Field(Length = 50)]
        public string first_name { get; set; }

        [Field(Length = 50)]
        public string last_name { get; set; }

        [Field(Precision=2), RangeConstraint(Min = 0)]
        // TODO: Unsaon ning precision?
        public decimal credit_limit { get; set; }

        [Field(Length = 80), RangeConstraint(Min = 0)]
        public string address { get; set; }

    }
}